package com.ruoyi.system.api.factory;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.CategoryService;

import com.ruoyi.system.api.domain.Category;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class RemoteCategoryFallbackFactory implements FallbackFactory<CategoryService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteCategoryFallbackFactory.class);

    @Override
    public CategoryService create(Throwable throwable)
    {
        log.error("Category服务调用失败:{}", throwable.getMessage());
        return new CategoryService() {


            @Override
            public Category getInfo(Long id) {
                return null;
            }
        };
    }
}
